[20251217] BOJ / G5 / 색칠하기 / 이준희 #1694
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🧷 문제 링크
https://www.acmicpc.net/problem/13265
🧭 풀이 시간
20분
👀 체감 난이도
✏️ 문제 설명
동그라미와 직선으로 그려진 그림의 동그라미에 색칠을 칠하고자 합니다.
이 때 직선으로 서로 연결되어 있는 동그라미 끼리는 색깔이 겹치지 않도록 할 때
2가지의 색으로 칠할 수 있으면 possible 안되면 impossible을 출력하는 문제입니다.
🔍 풀이 방법
bfs를 이용해서 풀었습니다.
점들을 순회하면서 색칠했을 때 다음 점이 지금 점의 색깔과 같으면 불가능인 것으로 판단했습니다.
⏳ 회고
색깔의 갯수 구하는 것이 아니어서 쉬운 문제였습니다.